<template>
  <div>
    <el-form style="display: inline-flex; flex-wrap: wrap; padding-top: 10px" >
      <slot name="query"> </slot>
      <el-form-item>
        <el-button type="success" :icon="Search" @click="querydata">查询</el-button>
      </el-form-item>
      <el-form-item>
        <el-button :icon="Refresh" type="info" @click="clearQuery">清空</el-button>
      </el-form-item>
      <el-form-item>
        <el-button :icon="Refresh" type="warning" @click="doReset">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup>
import { useSlots, provide, useAttrs, watch } from 'vue'
import { useCrudStore } from '/@/store'

const props = defineProps({
  listQuery: {
    type: Object,
    required: true,
    default: () => {},
  },
})
let { listQuery } = props
watch(listQuery, newValue => {
  console.log(newValue)
})
// 清空查询条件
const clearQuery = () => {
  listQuery = ref({})
  console.log(listQuery)
}
// 查询
const querydata = () => {
  const crudstore = useCrudStore()
  crudstore.$patch({
    listQuery,
  })
}

console.log(props.listQuery, 123)
</script>

<style lang="css" scoped>
</style>